package com.example.producer.service;

import com.example.producer.BoardCreation;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RabbitProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void produce() {
        char[][] board = new BoardCreation().create();
        if (board == null) {
            return;
        }
        rabbitTemplate.convertAndSend("work.queue", board);
    }
}
